// Product detail page
// ===================

define(['require', 'zepto', 'utils', 'page/protocol'], function(require, $, utils, protocol) {
  return {
    init: function(data) {
      
      this.onClickGoTopButton();
      this.onClickToQA();
      // init protocol
      protocol.init(window.__CTX__, window.__CTX__.root + "/shop?sku=" + data.productId + "&source=index&distributorId=" + data.distributorId, data.productType)
    },
    
    /**
     * Handler fired on clicking the 'Go Top' button
     */
    onClickGoTopButton: function() {
      var content = document.querySelector('.content')
      $('.button-up').on('click', function(e) {
        e.preventDefault()
        content.scrollTop = 0
      });
    },
    
    onClickToQA: function() {
      $(".to_qa").on("click", function(e) {
        $(".to_qa").hide();
        $(".qa").show();
      });
    }
  }
})